Skip to content

Fixing an extra FORMAT JSON in the query when attempting to insert a record#262

Open
AlexandrFiner wants to merge 1 commit into
smi2:masterfrom
AlexandrFiner:master
Open

Fixing an extra FORMAT JSON in the query when attempting to insert a record#262
AlexandrFiner wants to merge 1 commit into
smi2:masterfrom
AlexandrFiner:master

Conversation

@AlexandrFiner
Copy link
Copy Markdown

Summary

  • If the query contains the substring ON CLUSTER, an extra FORMAT JSON is added, which breaks the query

Problem

  • Checking for the presence of ON CLUSTER in a query does not take into account that it may be part of the data

Solution

  • A fast stripos() check is used as a first-level filter to detect the presence of ON CLUSTER in the SQL string.
  • preg_match() is only executed when the substring is present, providing a strict validation of the ON CLUSTER keyword.
  • Uses a regex to detect ON CLUSTER only as a SQL keyword, ignoring occurrences inside string literals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant